<?php

namespace App\Http\Controllers\Api;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Repository\UserRepository;
use App\Http\Resources\BrokerRecordsResource;
class UserController extends Controller
{
    //
    public function records(Request $request,UserRepository $userRepository){
        $user_id = auth('api')->id();
        $recordList = null;
        if(isset($user_id)){
            $recordList=$userRepository->getRecords($user_id);
        }
        return new BrokerRecordsResource($recordList);
    }
}
